<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改教师信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-teacher-edit" th:object="${teacher}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="numCheck" id="numCheck" th:field="*{numCheck}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">工号：</label>
                <div class="col-sm-8">
                    <input name="number" id="number" th:field="*{number}" readonly="readonly" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">职位：</label>
                <div class="col-sm-8">
                    <select name="position" class="form-control m-b" th:with="type=${@dict.getType('sys_post')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{position}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">电话：</label>
                <div class="col-sm-8">
                    <input name="telephone" th:field="*{telephone}" class="form-control" type="text">
                </div>
            </div>
           <!-- <div class="form-group">
                <label class="col-sm-3 control-label">简介：</label>
                <div class="col-sm-8">
                    <textarea name="Introduction" class="form-control">[[*{Introduction}]]</textarea>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <input name="passWord" th:field="*{passWord}" class="form-control" readonly="readonly" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">年级：</label>
                <div class="col-sm-8">
                    <select name="gradeId" class="form-control m-b" th:with="type=${@dict.getType('sys_grade')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{gradeId}"></option>
                    </select>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">专业：</label>
                <div class="col-sm-8">
                    <select name="professionalId" class="form-control m-b" th:with="type=${@dict.getType('sys_professional')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">班级：</label>
                <div class="col-sm-8">
                    <select name="classId" class="form-control m-b" th:with="type=${@dict.getType('sys_class')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{classId}"></option>
                    </select>
                </div>
            </div>-->
           <!-- <div class="form-group">
                <label class="col-sm-3 control-label">课程类型：</label>
                <div class="col-sm-8">
                    <select name="courseTypeId"  class="form-control m-b" th:with="type=${@dict.getType('sys_course_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{courseTypeId}"></option>
                    </select>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">课程：</label>
                <div class="col-sm-8">
                    <select name="courseId" class="form-control m-b" th:with="type=${@dict.getType('sys_course')}">
                        <option th:each="v:${courseChooses}" th:value="${v.courseId}" th:text="${v.courseName} "></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/teacher";
        $(function () {
            var num = $("#numCheck").val();
            if (num == '1'){
                $("#number").attr("readonly","readonly")
            }
        })
        $("#form-teacher-edit").validate({
            focusCleanup: true
        });
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-teacher-edit').serialize());
            }
        }
    </script>
</body>
</html>
